<?php
/*
Primary Author: Derek Shue 
Secondary: Alex Arey
Documentation: Cheng Yi
Updated: 12/10/2011
Module Description: The Community Partner Contacts form is used by community partners to add contact information.
*/
class Application_Form_CpContacts extends Zend_Form
{

    public function init()
    {
		$this->setMethod('post');
		
		$nameLenValid = new Zend_Validate_StringLength(array('max' => 30));
		$shortTextLenValid = new Zend_Validate_StringLength(array('max'=>8));
		$medTextLenValid = new Zend_Validate_StringLength(array('max' => 60));
		$emailLenValid = new Zend_Validate_StringLength(array('max' => 100));
		$longTextLenValid = new Zend_Validate_StringLength(array('max' => 120));
		$phonevalid = new Zend_Validate_Regex(array('pattern' => '/^\(\d\d\d\) ?\d\d\d-\d\d\d\d$/'));
		
		$this->addElement('hidden','CONTACTID',array(
			)
		);	
		
		$this->addElement('text','PREFIX',array(
			'label' => 'Prefix:',
			'filters' => array('StringTrim'),
			'validators' => array($shortTextLenValid),	
			)
		);
		$this->addElement('text','FIRSTNAME',array(
			'label' => 'First Name:',
			'filters' => array('StringTrim'),
			'validators' => array($nameLenValid),
	    	'required' => True,
			)
		);
		$this->addElement('text','LASTNAME',array(
			'label' => 'Last Name:',
			'filters' => array('StringTrim'),
			'validators' => array($nameLenValid),
	    	'required' => True,
			)
		);
		$this->addElement('text','SUFFIX',array(
			'label' => 'Suffix:',
			'filters' => array('StringTrim'),
			'validators' => array($shortTextLenValid),
			)
		);

		$this->addElement('text','JOBTITLE',array(
			'label' => 'Job Title:',
			'filters' => array('StringTrim'),
			'validators' => array($medTextLenValid),
	    	'required' => True,
			)
		);
		$this->addElement('text','PHONE',array(
			'label' => 'Phone:(Format: (###) ###-####)',
			'filters' => array('StringTrim'),
			'validators' => array($phonevalid),
	    	'required' => True,
			)
		);
		$this->addElement('text','EXTENSION',array(
			'label' => 'Extension:',
			'filters' => array('StringTrim'),
			'validators'=>array('Digits',$shortTextLenValid),
			)
		);
		
		$this->addElement('text','FAX',array(
			'label' => 'Fax:',
			'filters' => array('StringTrim'),
			'validators' => array($phonevalid),
			)
		);
		
		$this->addElement('text','ADDRESS1',array(
			'label' => 'Address Line 1:',
			'filters' => array('StringTrim'),
			'validators' => array($longTextLenValid),
	    	'required' => True,
			)
		);
		$this->addElement('text','ADDRESS2',array(
			'label' => 'Address Line 2:',
			'filters' => array('StringTrim'),
			'validators' => array($longTextLenValid),
			)
		);
		$this->addElement('text','CITY',array(
			'label' => 'City:',
			'filters' => array('StringTrim'),
			'validators' => array($nameLenValid),
	    	'required' => True,
			)
		);
		
		$this->addElement('text','STATE',array(
			'label' => 'State:',
			'filters' => array('StringTrim'),
			'validators' => array($nameLenValid),
	    	'required' => True,
			)
		);
		
		$this->addElement('text','ZIP',array(
			'label' => 'Zip Code:',
			'filters' => array('StringTrim'),
			'validators' => array($shortTextLenValid, 'Digits'),
	    	'required' => True,
			)
		);
		
		$this->addElement('text','EMAIL',array(
			'label' => 'Email:',
			'filters' => array('StringTrim'),
			'validators' => array($emailLenValid),
	    	'required' => True,
			)
		);
		
		
		
		$this->addElement('submit','submit',array(
	 	   'label' => 'Add Contact')
		);
	}

	
/*	CONTACTID	NUMBER
CPID	NUMBER
PREFIX	VARCHAR2
FIRSTNAME	VARCHAR2
MIDDLENAME	VARCHAR2
LASTNAME	VARCHAR2
SUFFIX	VARCHAR2
GENDER	VARCHAR2
JOBTITLE	VARCHAR2
PHONE	VARCHAR2
EXTENSION	VARCHAR2
FAX	VARCHAR2
ADDRESS1	VARCHAR2
ADDRESS2	VARCHAR2
ADDRESS3	VARCHAR2
CITY	VARCHAR2
STATE	VARCHAR2
ZIP	VARCHAR2
EMAIL	VARCHAR2
*/
	
}
?>
